package itheima.C03_转换流;

import java.io.*;

public class Test2 {
    public static void main(String[] args) {
        //转换流：字节流转换为字符流
        //InputStreamReader:字节输入流转换为字符输入流
        //OutputStreamWriter:字节输出流转换为字符输出流
        //构造方法：
        //InputStreamReader(InputStream in)
        //InputStreamReader(InputStream in,String charsetName)
        //OutputStreamWriter(OutputStream out)
        //OutputStreamWriter(OutputStream out,String charsetName)
        try(
                PrintWriter ps=new PrintWriter("Day11_io\\src\\itheima\\C03_转换流\\a.txt");

                PrintWriter ps1=new  PrintWriter(new File("Day11_io\\src\\itheima\\C03_转换流\\b.txt","utf-8"));
                PrintWriter ps2=new  PrintWriter(new File("Day11_io\\src\\itheima\\C03_转换流\\c.txt"),"utf-8");

                ){
            ps.println("adfd");
            ps.println(2.2);
            ps.println(true);
            ps.println('a');
            ps.println(666);
            ps.println("你好asduiofuiyaweg54436");


            ps.write("你好asduiofuiyaweg54436");
            ps.write("你好asduiofuiyaweg54436");
            ps.write("你好asduiofuiyaweg54436");
            ps.write(666);
            ps.write("54436");
            ps.write(String.valueOf(true));



        } catch (FileNotFoundException e) {
            throw new RuntimeException(e);
        } catch (UnsupportedEncodingException e) {
            throw new RuntimeException(e);
        }

    }
}
